<?php defined('SYSPATH') or die('No direct script access.');

class Model_Permissao extends ORM {

	public function exists()
	{
		return ORM::factory('permissao')
			->where('controlador', '=', $this->controlador)
			->and_where('acao', '=', $this->acao)
			->find()
			->loaded();
	}
	
	public $_belongs_to = array();
	
	public $_has_one = array();
	
	public $_has_many = array(
		'usuarios' => array(
			'model' => 'usuario',
			'foreign_key' => 'permissoe_id',
			'through' => 'permissoes_usuarios'
		),
	);
	
	public $_table_name = 'permissoes';
	public $_primary_key = 'id';
	
} // End Permissao
